home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
c80tcog.lbr
/
CTYPE.CQ
/
ctype.c
Wrap
Text File
|
1985-08-09
|
2KB
|
88 lines
/* ctype.c - character classification functions */
/* 1982/10/10 12:21
Copyright 1982 William G. Hutchison, Jr.
P.O. Box 278
Exton, PA 19341-0278
U.S.A.
CompuServe 70665,1307
These functions may be used freely for any non-commercial
purpose, provided that the user does not remove or alter
this notice or the copyright statement.
Those who wish to sell or lease these functions, or to
incorporate them into a product for sale or lease, should
apply to the author (above) for licensing information.
These functions are not covered by a warranty, either
express or implied. The author shall not be responsible for
any damages (including consequential) caused by reliance on
the materials presented, including but not limited to
typographical errors or arithmetic errors.
NOTE: The names and functions of these sub-programs are
the same as certain sub-programs provided with the UNIX
system (tm Western Electric Co.), but these sub-programs are
original work, not copies of the UNIX sub-programs.
*/
/* definitions for Software Toolworks C/80 Version 2.0: */
#ifdef MAINLY
#else
#include "c80def.h"
#endif
#ifdef ASCII
isalnum(c) char c;
{
return(isalpha(c) || isdigit(c));
}
isalpha(c) char c;
{
return(islower(c) || isupper(c));
}
isascii(c) char c;
{
int b;
return(0 <= (b=c & 0xFF) && b <= 0x7F);
}
iscntrl(c)/* is c a control character */ char c;
{
int b;
return((0 <= (b=c & 0xFF) && b < ' ') || b == 0x7F);
}
isdigit(c) char c;
{
return('0' <= c && c <= '9');
}
islower(c) char c;
{
return('a' <= c && c <= 'z');
}
ispunct(c)/* is c punctuation? */ char c;
{
return(
isascii(c) && !(isalnum(c) || iscntrl(c)));
}
isprint(c) char c;
{
return(' ' <= c && c < 0x7F);
}
isspace(c) char c;
{
return(
(c == ' ')
|| (c == '\t')
|| (c == '\n')
|| (c == '\015') /* CR */
|| (c == '\014') /* FF */
);
}
isupper(c) char c;
{
return('A' <= c && c <= 'Z');
}
#endif